/*
 * Copyright 2012 Marsrutai.lt
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package lt.marsrutai.mobile.android.adapter;

import lt.marsrutai.mobile.android.R;
import lt.marsrutai.mobile.android.model.StopBookmark;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class StopBookmarkAdapter extends BookmarkAdapter<StopBookmark> {

    public StopBookmarkAdapter(Context context) {
        super(context, R.layout.bookmark_stop_item);
    }

    @Override
    public View doGetView(final int position, View view, final ViewGroup parent) {

        StopBookmark stopBookmark = getItem(position);

        if (stopBookmark != null) {
            TextView stopName = (TextView) findViewById(view, R.id.stop_name);
            stopName.setText(stopBookmark.getStopName());

            TextView directionName = (TextView) findViewById(view, R.id.direction_name);
            directionName.setText(stopBookmark.getStopDirectionName());
        }

        return super.doGetView(position, view, parent);
    }
}
